class PWNActorSandbox extends Actor
	placeable;

var PWNPawn Player;

//Report on distance between player and testpawn
var() bool reportOnDistance;
var() int reportingInterval;
var() int reportCount;

event PostBeginPlay()
{
	super.PostBeginPlay();
	//reportOnDistance=true;
	if(reportOnDistance==true)
	{
		reportingInterval=50;
	}

	//SetHidden(true);
}

simulated private function PWNActorSandbox(string sMessage)
{
	GetALocalPlayerController().ClientMessage(sMessage);	
}

event Tick(float DeltaTime)
{
	local PWNPawn P;
	//local float PtoActor;

	super.Tick(DeltaTime);
	//PtoActor = (Player.Location - Location);

	if (reportOnDistance)
	{

		if (reportCount>=reportingInterval)
			{

				foreach WorldInfo.AllPawns(class'PWNPawn',P)
					{
						Player=P;
					}

						if (VSize(Player.Location - Location)<300.00)
						{
							`log("Player is close!");
						}

				`log("Distance to testpawn: " $VSize(Player.Location - Location));
				reportCount=0;
				}

				reportCount++;
	}
	//`log(Location);
	//`log(Player.Location);
}



DefaultProperties
{
	Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
    StaticMesh=StaticMesh'MyObjects.Meshes.MyStaticMesh1'
    End Object
	Components.Add(StaticMeshComponent0)
	
	reportOnDistance = false
	reportCount=0
	reportingInterval=100
}
